package com.qf.dto;

import com.qianfeng.smsplatform.common.constants.ResutlDataEnum;

/*
 * @Data: 2021/7/13 22:40
 * */
public class R {
    private String code;
    private String msg;
    private Object result;

    public static R getR(ResutlDataEnum dataEnum){

        return getR(dataEnum,null);
    }
    public static R getR(ResutlDataEnum dataEnum,Object result){
        R r=new R();
        r.setCode(dataEnum.getCode());
        r.setMsg(dataEnum.getMsg());
        r.setResult(result);
        return r;
    }
    public static R getR(String code,String msg,Object result){
        R r = new R();
        r.setCode(code);
        r.setMsg(msg);
        r.setResult(result);
        return r;
    }


    public void setCode(String code) {
        this.code = code;
    }
    public String getCode() {
        return code;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
    public String getMsg() {
        return msg;
    }

    public void setResult(Object result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return "R{" +
                "code='" + code + '\'' +
                ", msg='" + msg + '\'' +
                ", result=" + result +
                '}';
    }
}
